from typing import List
from functools import reduce

class Solution:
    def arraySign(self, nums: List[int]) -> int:
        ans = True
        for num in nums:
            if num == 0:
                return 0
            if num < 0:
                ans = not ans
        return 1 if ans else 0

    def arraySign2(self, nums: List[int]) -> int:
        if 0 in nums:
            return 0
        return 1 if reduce(lambda x,y: x*y, nums) > 0 else -1